Skip to content

Etasu endpoints#49

Merged
plarocque4 merged 21 commits intodevfrom
etasu-endpoints
Feb 14, 2023
Merged

Etasu endpoints#49
plarocque4 merged 21 commits intodevfrom
etasu-endpoints

Conversation

@smalho01
Copy link
Copy Markdown
Collaborator

Describe your changes

This is dependent on changing to MonogDB, there are too many DB calls made for submitting requirements correctly and TingoDB requires you to handle DB calls via callbacks, which very quickly gets messy with multiple nested callbacks. Changing to MongoDB will allow us to use promises instead (supported by async await) which will make overall execution more straightforward and the code easier to read, so I am waiting on those changes since we are switching to MongoDB anyways.

Also the DB init and schema definitions need to be moved out to another file as to not create unnecessary clutter in the codebase.

Issue ticket number and Jira link

Please include the Jira Ticket Number and Link for this issue/task.

Checklist before requesting a review

  • I have performed a self-review of my code
  • Ensure the target / base branch for any feature PR is set to dev not main (the only exception to this is releases from dev and hotfix branches)

Checklist for conducting a review

  • Review the code changes and make sure they all make sense and are necessary.
  • Pull the PR branch locally and test by running through workflow and making sure everything works as it is supposed to.

Workflow

Owner of the Pull Request will be responsible for merge after all requirements are met, including approval from at least one reviewer. Additional changes made after a review will dismiss any approvals and require re-review of the additional updates. Auto merging can be enabled below if additional changes are likely not to be needed. The bot will auto assign reviewers to your Pull Request for you.

@smalho01 smalho01 changed the base branch from main to dev January 26, 2023 16:59
@smalho01 smalho01 changed the title Draft - Etasu endpoints Etasu endpoints Feb 9, 2023
@smalho01
Copy link
Copy Markdown
Collaborator Author

smalho01 commented Feb 9, 2023

this is working - what's left to do is to environmentalize variables with the docker configuration - env.json overrides everything that gets set via docker, need to figure out some workaround. Also fixing the limiting errors

@smalho01 smalho01 changed the base branch from dev to use-mongo February 9, 2023 20:49
Base automatically changed from use-mongo to dev February 9, 2023 21:09
Comment thread docker-sync.yml
src: '.'
sync_excludes: ['node_modules', 'logs']

rems_dev_pharmacy-information-system-sync:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be removed or is it kept around for a reason?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be removed, good catch

Comment thread src/fhir/utilities.ts Outdated

// define schemas
const medicationCollection = await db.collection('medication-requirements'
// , {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these comments to show the structure?
If so maybe a comment stating that would be good. Otherwise it should be removed.

Comment thread src/fhir/utilities.ts Outdated
await medicationCollection.createIndex({ name: 1 }, { unique: true });

const metRequirementsCollection = await db.collection('met-requirements'
// , {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these comments to show the structure?
If so maybe a comment stating that would be good. Otherwise it should be removed.

Comment thread src/fhir/utilities.ts Outdated


const remsCaseCollection = await db.collection('rems-case'
// , {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these comments to show the structure?
If so maybe a comment stating that would be good. Otherwise it should be removed.

Comment thread src/server.ts Outdated
const patientName = patient.name[0].given[0] + ' ' + patient.name[0].family;

const drug = await medicationCollection.findOne({ code: prescriptionCode, codeSystem: prescriptionSystem }
// , (err: any, result: any) => {
Copy link
Copy Markdown
Contributor

@plarocque4 plarocque4 Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleanup these comments?

Comment thread src/server.ts
}

configureEtasuEndpoints() {
const db = Globals.database;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anyway we can split-up this huge method and move it into an ETASU specific file?

Copy link
Copy Markdown
Contributor

@plarocque4 plarocque4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@plarocque4 plarocque4 merged commit e5c4e15 into dev Feb 14, 2023
@plarocque4 plarocque4 deleted the etasu-endpoints branch February 14, 2023 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants